/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Heinz Hernandez
 */
@Entity
@Table(name = "veterinary")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Veterinary.findAll", query = "SELECT v FROM Veterinary v"),
    @NamedQuery(name = "Veterinary.findByVetId", query = "SELECT v FROM Veterinary v WHERE v.vetId = :vetId"),
    @NamedQuery(name = "Veterinary.findByVetFocus", query = "SELECT v FROM Veterinary v WHERE v.vetFocus = :vetFocus"),
    @NamedQuery(name = "Veterinary.findByVetSpeciality", query = "SELECT v FROM Veterinary v WHERE v.vetSpeciality = :vetSpeciality"),
    @NamedQuery(name = "Veterinary.findByVetSalary", query = "SELECT v FROM Veterinary v WHERE v.vetSalary = :vetSalary"),
    @NamedQuery(name = "Veterinary.findByVetGraduateAt", query = "SELECT v FROM Veterinary v WHERE v.vetGraduateAt = :vetGraduateAt")})
public class Veterinary implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "VET_ID")
    private Long vetId;
    @Basic(optional = false)
    @Column(name = "VET_FOCUS")
    private String vetFocus;
    @Basic(optional = false)
    @Column(name = "VET_SPECIALITY")
    private String vetSpeciality;
    @Basic(optional = false)
    @Column(name = "VET_SALARY")
    private String vetSalary;
    @Basic(optional = false)
    @Column(name = "VET_GRADUATE_AT")
    private String vetGraduateAt;
    @JoinColumn(name = "PER_ID", referencedColumnName = "PER_ID")
    @ManyToOne
    private Person perId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "vetId")
    private List<Appointment> appointmentList;

    public Veterinary() {
    }

    public Veterinary(Long vetId) {
        this.vetId = vetId;
    }

    public Veterinary(Long vetId, String vetFocus, String vetSpeciality, String vetSalary, String vetGraduateAt) {
        this.vetId = vetId;
        this.vetFocus = vetFocus;
        this.vetSpeciality = vetSpeciality;
        this.vetSalary = vetSalary;
        this.vetGraduateAt = vetGraduateAt;
    }

    public Long getVetId() {
        return vetId;
    }

    public void setVetId(Long vetId) {
        this.vetId = vetId;
    }

    public String getVetFocus() {
        return vetFocus;
    }

    public void setVetFocus(String vetFocus) {
        this.vetFocus = vetFocus;
    }

    public String getVetSpeciality() {
        return vetSpeciality;
    }

    public void setVetSpeciality(String vetSpeciality) {
        this.vetSpeciality = vetSpeciality;
    }

    public String getVetSalary() {
        return vetSalary;
    }

    public void setVetSalary(String vetSalary) {
        this.vetSalary = vetSalary;
    }

    public String getVetGraduateAt() {
        return vetGraduateAt;
    }

    public void setVetGraduateAt(String vetGraduateAt) {
        this.vetGraduateAt = vetGraduateAt;
    }

    public Person getPerId() {
        return perId;
    }

    public void setPerId(Person perId) {
        this.perId = perId;
    }

    @XmlTransient
    public List<Appointment> getAppointmentList() {
        return appointmentList;
    }

    public void setAppointmentList(List<Appointment> appointmentList) {
        this.appointmentList = appointmentList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (vetId != null ? vetId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Veterinary)) {
            return false;
        }
        Veterinary other = (Veterinary) object;
        if ((this.vetId == null && other.vetId != null) || (this.vetId != null && !this.vetId.equals(other.vetId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Veterinary[ vetId=" + vetId + " ]";
    }
    
}
